package com.chen.pojo.bean;

import com.chen.pojo.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    private int id;
    private String type;
    private String userName;
    private String nickName;
    private int age;
    private String sex;
    private String address;
    private String avatar;
    private int role;
    private String introduction;
    private String[] roles; //角色

    public UserInfo(User user) {
        this.id = user.getId();
        this.age = user.getAge();
        this.sex = user.getSex();
        this.address = user.getAddress();
        this.role = user.getRole();
        this.userName = user.getUsername();
       // this.userName = user.getUsername();
//        this.avatar = user.getAvatar() != null ? user.getAvatar() : "https://himg.bdimg.com/sys/portrait/item/public.1.cc186001.v5cWpNYBr9dC7t716NhTdw.jpg";

        this.avatar=user.getAvatar();
        this.nickName = user.getNick();


    }


}
